import time

import requests

# 定义目标URL
url = 'http://127.0.0.1:40000/task'


def query():
    response = requests.get(url + '/query')
    print(response.text)


def create(id):
    id = str(id)
    data = {
        "taskName": "测试名称:"+id,
        "source": "来源家庭:"+id
    }
    response = requests.post(url + '/create', headers={'Content-Type': 'application/json'}, json=data)
    print(response.text)


def updateStatus(id):
    response = requests.get(url + '/updateStatus/' + str(id))
    print(response.text)


def addRemark():
    data = {
        "id": 1287766017,
        "remark": "加的备注3"
    }
    response = requests.post(url + '/addRemark', headers={'Content-Type': 'application/json'}, json=data)
    print(response.text)

def queryAllSource():
    response = requests.get(url + '/queryAllSource')
    print(response.text)



if __name__ == '__main__':

    # for i in range(10):
    #     create(i)
    #     time.sleep(1)

    # query()
    # addRemark()
    # updateStatus(2059427841)
    queryAllSource()